package org.sy.lab.多线程基础._2_同步._1_synchronized._2_使用条件;

public class Main {

	public static void main(String[] args) {
		
		Storage storage = new Storage();
		
		Producer producer1 = new Producer(storage, 10);
		Producer producer2 = new Producer(storage, 10);
		Producer producer3 = new Producer(storage, 10);
		Producer producer4 = new Producer(storage, 50);
		Producer producer5 = new Producer(storage, 10);
		Producer producer6 = new Producer(storage, 10);
		Producer producer7 = new Producer(storage, 50);
		Producer producer8 = new Producer(storage, 10);
		Producer producer9 = new Producer(storage, 10);
		Producer producer10 = new Producer(storage, 10);
		
		Consumer consumer1 = new Consumer(storage, 50);
		Consumer consumer2 = new Consumer(storage, 20);
		Consumer consumer3 = new Consumer(storage, 30);
		
		Thread thread1 = new Thread(producer1, "生产者1");
		Thread thread2 = new Thread(producer2, "生产者2");
		Thread thread3 = new Thread(producer3, "生产者3");
		Thread thread4 = new Thread(producer4, "生产者4");
		Thread thread5 = new Thread(producer5, "生产者5");
		Thread thread6 = new Thread(producer6, "生产者6");
		Thread thread7 = new Thread(producer7, "生产者7");
		Thread thread8 = new Thread(producer8, "生产者8");
		Thread thread9 = new Thread(producer9, "生产者9");
		Thread thread10 = new Thread(producer10, "生产者10");
		Thread thread11 = new Thread(consumer1, "消费者1");
		Thread thread12 = new Thread(consumer2, "消费者2");
		Thread thread13 = new Thread(consumer3, "消费者3");
		
		thread11.start();
		thread12.start();
		thread13.start();
		thread1.start();
		thread2.start();
		thread3.start();
		thread4.start();
		thread5.start();
		thread6.start();
		thread7.start();
		thread8.start();
		thread9.start();
		thread10.start();
	}
}
